package com.gxa.common.vo;
import com.gxa.common.constant.Constants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 返回layui数据表格的统一对象
 */
@Data
@AllArgsConstructor
public class JsonResult<T> {
    private Integer code = Constants.SUCCESS;
    private String msg;
    private long count;
    private T data;

    public JsonResult() {
    }

    public JsonResult(T data) {
        this.data = data;
    }



    public JsonResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public JsonResult(String msg, long count, T data) {
        this.msg = msg;
        this.count = count;
        this.data = data;
    }
    public JsonResult(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
